//
//  CommentTableViewCell.m
//  AppYing
//
//  Created by appying_wxj on 14/11/10.
//  Copyright (c) 2014年 appying_wxj. All rights reserved.
//

#import "CommentTableViewCell.h"

@implementation CommentTableViewCell
@synthesize line,headImage,addressLabel,praiseImageView,praiselabel,timeLabel,contentLabel;
- (void)awakeFromNib {
    // Initialization code
}
-(instancetype)initWithStyle:(UITableViewCellStyle)cellStyle reuseIdentifier:(NSString *)indentifier
{
    self = [super initWithStyle:cellStyle reuseIdentifier:indentifier];
    if (self)
    {
        // 分割的线
        line = [[UIView alloc] initWithFrame:CGRectMake(10, 99.5, kScreen_Width-20, 0.5)];
        line.backgroundColor = [UIColor lightGrayColor];
        [self addSubview:line];
        
        // 显示评论人得个人图片的设置
        headImage= [[UIImageView alloc] initWithFrame:CGRectMake(10, 5, 40, 40)];
        headImage.backgroundColor = [UIColor grayColor];
        headImage.image = [UIImage imageNamed:@"image_touxiang@2x"];
        headImage.layer.masksToBounds = YES;
        headImage.layer.cornerRadius = 20;// 图片截取成圆形
        [self addSubview:headImage];
        
        
        // 赞的图片
        praiseImageView = [[UIImageView alloc] initWithFrame:CGRectMake(kScreen_Width-25, 10, 15, 15)];
        //praiseImageView.image = [UIImage imageNamed:@"image_zan@2x"];
        praiseImageView.backgroundColor = [UIColor clearColor];
        [self addSubview:praiseImageView];
        
        // 显示地址信息的lab
        addressLabel = [[UILabel alloc] initWithFrame:CGRectMake(55, 12, 120, 10)];
        //        addressLabel.text = @"来自上海的网友";
        addressLabel.font = [UIFont systemFontOfSize:10];
        addressLabel.textColor = [UIColor blackColor];
        addressLabel.backgroundColor = [UIColor clearColor];
        [self addSubview:addressLabel];
        
        // 赞这篇文章的多少人
        praiselabel = [[UILabel alloc] initWithFrame:CGRectMake(kScreen_Width-33-25, 10, 33, 18)];
        praiselabel.text = @"1234";
        praiselabel.textColor = [UIColor colorWithRed:0.31 green:0.42 blue:0.54 alpha:1];
        praiselabel.font = [UIFont systemFontOfSize:12];
        [self addSubview:praiselabel];
        
        // 显示发表时间
        timeLabel = [[UILabel alloc] initWithFrame:CGRectMake(55, 30, 100, 10)];
        timeLabel.text = @"12分钟前";
        timeLabel.textColor = [UIColor lightGrayColor];
        timeLabel.font = [UIFont systemFontOfSize:10];
        [self addSubview:timeLabel];
        
        // 显示评论的内容
        contentLabel = [[UILabel alloc] initWithFrame:CGRectMake(55, 42, kScreen_Width-10-55, 55)];
        contentLabel.text = @"为了避免界面在处理耗时的操作时卡死比如读取网络数据，IO,数据库读写等，我们会在另外一个线程中处理这些操作，然后通知主线程更新界面。";
        contentLabel.font = [UIFont systemFontOfSize:13];
        contentLabel.textColor = [UIColor blackColor];
        contentLabel.numberOfLines = 0;//
        [self addSubview:contentLabel];
        

    }
    return self;
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    

    // Configure the view for the selected state
    
    
    [super setSelected:selected animated:animated];
}

@end
